<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    {{info}}
    <ul>
        <!--v-for="遍历 in 数组" 循环遍历指令,遍历的同时生成元素对象-->
        <li v-for="name in arr">{{name}}</li>
    </ul>
    <table border="1">
        <caption>人物列表</caption>
        <tr>
            <th>姓名</th><th>年龄</th><th>工资</th>
        </tr>
        <tr v-for="p in persons">
            <td>{{p.name}}</td>
            <td>{{p.age}}</td>
            <td>{{p.salary}}</td>
        </tr>
    </table>
    <table border="1">
        <caption>商品列表</caption>
        <tr>
            <th>商品名</th><th>价格</th><th>销量</th>
        </tr>
        <tr v-for="p in productArr">
            <td>{{p.title}}</td>
            <td>{{p.price}}</td>
            <td>{{p.saleCount}}</td>
        </tr>
    </table>
</div>
<script src="js/vue.min.js"></script>
<script>
    let v = new Vue({
        el: "body>div",
        data: {
            info: "循环遍历测试",
            arr:["刘备","关羽","张飞"],
            persons:[{name:"张三",age:18,salary:3000},
                {name:"李四",age:28,salary:4000},
                {name:"王五",age:38,salary:5000}],
            productArr:[{title:"双飞燕鼠标",price:20,saleCount:100},
                {title:"罗技键盘",price:80,saleCount:200},
                {title:"联想电脑",price:5320,saleCount:500}]

        }
    })
</script>
</body>
</html>